﻿@using JULONG.WEB.Library
@model IEnumerable<DFYE.Web.Models.guestBook>
@{
    paging paging = new paging();
    dynamic pagingMode;
    paging.pageSize = 10;
    var vModel = paging.content(
        Model,
        out pagingMode, Html.getRoute("page").As<int>()
        );
    ViewBag.paging = pagingMode;
}
<h2 class="pageTitle">留言板</h2>
@Html.Partial("paging", new { action = "Index" })
@foreach (var item in vModel)
{
    <div class="gbBox">
        <div class="gbBoxTop"><label class="name">@item.name</label>&#160;于 <label class="date">@String.Format("{0:g}", item.datetime)</label> 说：</div>  
        <div class="gbBoxFoot">来自：<label>@item.getIP()</label></div>
        <div class="gbBoxContent">@item.content</div>
        
        @if (!string.IsNullOrWhiteSpace(item.replyContent))
        {
        <div class="gbBoxReply">
            <div><label class="top">回复：</label><label class="date">@String.Format("{0:g}", item.replyDatetime)</label> </div>
            <div class="Content">@item.replyContent</div>
        </div>
        }
    </div>
}
@Html.Partial("paging", new { action = "Index" })
<div>
@using (Html.BeginForm()) {
    
    <div class="postTitle">我有话要说</div>
    <div class="postName">您的称呼：@Html.TextBox("name", "")</div>
    <div class="postContent"><span style="vertical-align:top;">留言内容：</span>@Html.TextArea("content", "")</div>
    <div class="postSubmit"><input type="submit" value="创建" /></div>
}
</div>
@section Head{
<style type="text/css">
    
    .gbBox{padding:15px; border-top:1px dashed #909090;}
    .gbBoxTop .name { display:block; float:left ; color:#8B67C4; font-weight:800; }
    .gbBoxTop .date {  color:#444; font-family:Cambria; font-size:10px;}
    .gbBoxContent { margin-top:2px  ; padding:5px; padding-left:20px; font-size:14px; color:#666  }
    .gbBoxFoot {color:#8B67C4; font-family:Cambria; }
    .gbBoxReply { background-color: #fcfff8; margin:5px 0px 0px 0px ; padding:10px; border:1px solid #e7f6d7}
    .gbBoxReply .top { display:block; float:left ; color:#73b230; font-weight:800;}
    .gbBoxReply .date { float:right; display:block;  color:#444; font-family:Cambria; font-size:10px;}
    .gbBoxReply .Content { margin:1.5em 0px 0px 1.5em; font-size:14px;}
    .gbBoxFoot{ float:right;}
    .gbBoxFoot .from{ float:right;}
    
    .postTitle{ background-color:#fff; padding:8px 5px 3px 15px; font-weight:800; border-bottom:1px solid #e0e0e0}
    .postName{ padding:8px 5px 3px 15px;  font-weight:800;}
    .postName input{ border: 1px solid #999}
    .postContent{ padding:8px 5px 3px 15px;  font-weight:800;}
    .postContent textarea{ border: 1px solid #999; width:450px; height:100px; overflow:auto;}
    .postSubmit input{  background-color:#f1f1f1; border:1px solid #d0d0d0; color:#999; margin:10px 0px 5px 80px;}

</style>
}